package de.fhaugsburg.games.boardgames;

/**
 * A square is part of board, each square has a specific piece or is empty.
 * default the square is empty.
 * 
 * @author r4smus
 * 
 */
public class Square {

	private Piece piece;

	/**
	 * put a piece on the square.
	 * 
	 * @param piece
	 */
	public void putPiece(Piece piece) {
		this.piece = piece;
	}

	/**
	 * 
	 * @return the piece on the square
	 */
	public Piece getPiece() {
		return this.piece;
	}

	/**
	 * removes the piece on the square
	 * 
	 * @return the piece which was removed.
	 */
	public Piece removePiece() {
		Piece tempPiece = this.piece;
		this.piece = null;
		return tempPiece;
	}

}
